package com.atguigu.gmall.web.controller;

import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * @author A
 * @version 1.0
 * @description: TODO
 * @date 2024/10/3 1:15
 */
@Controller
public class LoginController {
    //Controller注解返回的是视图html页面或者jsp
    //RestController注解返回的是json,xml(ajax需要的json数据)

    //originUrl: 登录成功后跳回的路径
    @GetMapping("/login.html")
    public String login(@RequestParam("originUrl") String originUrl, Model model){
        System.out.println("originUrl = " + originUrl);
        model.addAttribute("originUrl",originUrl);
        return "login";
    }
}
